<?php

use Vinlon\Laravel\LayAdmin\SideBar;
use Vinlon\Laravel\LayAdmin\SideBarCollection;

$sidebars = new SideBarCollection();

/* 在此处定义应用菜单 */
$sidebars->add(
    SideBar::create('corp', '合作机构')->iconClass('layui-icon-senior')
        ->add(SideBar::create('corp.agent', '代理列表')->jumpTo('agent/index'))
        ->add(SideBar::create('corp.partner', '合作商列表')->jumpTo('partner/index'))
);
$sidebars->add(
    SideBar::create('product', '商品管理')->iconClass('layui-icon-note')
        /*->add(SideBar::create('product.list', '商品列表')->jumpTo('product/index'))*/
        ->add(SideBar::create('product.issue', '发行商品')->jumpTo('product/issue'))
        ->add(SideBar::create('product.resale', '转售商品')->jumpTo('product/resale'))
        ->add(SideBar::create('product.blind_box', '肓盒商品')->jumpTo('product/blind_box'))
);
$sidebars->add(
    SideBar::create('activity', '活动管理')->iconClass('layui-icon-fire')
        ->add(SideBar::create('activity.invite', '邀请活动')->jumpTo('invite/index'))
        ->add(SideBar::create('activity.airdrop', '商品空投')->jumpTo('airdrop/index'))
        ->add(SideBar::create('activity.airdrop_blind_box', '盲盒空投')->jumpTo('airdrop/blind_box'))
        ->add(SideBar::create('activity.convert', '合成')->jumpTo('convert/index'))
);
$sidebars->add(
    SideBar::create('user', '用户管理')->iconClass('layui-icon-user')
        ->add(SideBar::create('user.list', '用户列表')->jumpTo('user/index'))
);
$sidebars->add(
    SideBar::create('order', '订单管理')->iconClass('layui-icon-cart')
        ->add(SideBar::create('order.list', '发行订单')->jumpTo('order/index'))
        ->add(SideBar::create('order.resale', '转售订单')->jumpTo('order/resale'))
        ->add(SideBar::create('order.blind_box', '肓盒订单')->jumpTo('order/blind_box'))
        ->add(SideBar::create('order.settings', '设置')->jumpTo('order/settings'))
);
# 无用的功能，暂时隐藏
//$sidebars->add(
//    SideBar::create('registry', '登记管理')->iconClass('layui-icon-tabs')
//        ->add(SideBar::create('registry.list', '登记列表')->jumpTo('registry/index'))
//        ->add(SideBar::create('registry.agent_settle', '代理结算')->jumpTo('registry/agent_settle'))
//);
$sidebars->add(
    SideBar::create('ops', '运维管理')->iconClass('layui-icon-util')
        ->add(SideBar::create('ops.settings', '系统设置')->jumpTo('ops/settings'))
        ->add(SideBar::create('ops.enterprises', '企业开户')->jumpTo('ops/enterprises'))
        ->add(SideBar::create('ops.userimport', '用户导入')->jumpTo('ops/userimport'))
        ->add(SideBar::create('ops.download', '下载中心')->jumpTo('ops/download'))
);

// 默认菜单
$sidebars->add(
    SideBar::create('_user', '系统管理员')->iconClass('layui-icon-key')->jumpTo('_base/user/user/')
);
$sidebars->add(
    SideBar::create('_my', '我的')->iconClass('layui-icon-username')
        ->add(SideBar::create('_my.profile', '基本资料')->jumpTo('_base/user/user/info'))
        ->add(SideBar::create('_my.password', '修改密码')->jumpTo('_base/user/user/password'))
);

return [
    /*
     * Admin页面Route Prefix
     * 默认值： admin, 此时管理页面访问地址为 http://localhost:8000/admin
     */
    'route_prefix' => env('LAY_ADMIN_ROUTE_PREFIX', 'admin'),

    /*
     * Admin后台显示名称
     */
    'display_name' => env('LAY_ADMIN_DISPLAY_NAME', '后台管理系统'),

    /*
     * 自定义middleware
     */
    'middleware' => [
        \App\Http\Middleware\XssDefense::class,
    ],

    /*
     * 菜单定义
     */
    'sidebars' => $sidebars->toArray(),

    /*
     * 角色定义类
     */
    'role_class' => \App\AdminRoleExtend::class,
];
